import java.util.Random;
public class yanzhengma {
    public static void main(String[] args) {
        for (int i = 1; i < 3; i++) {
            String verification = verificationCode();
            System.out.println("第" + i + "次验证码为：" + verification);
        }
    }
            public static String verificationCode(){
                String verification = "";
                Random r = new Random();
                int num ;
                for (int i = 0; i < 5; i++) {
                    num = r.nextInt(3)+1;
                    switch (num){
                        case 1:
                            verification=verification + r.nextInt(10);
                            break;
                            case 2:
                                verification=verification + (char)(r.nextInt(26)+65);
                                break;
                        case 3:
                            verification=verification + (char)(r.nextInt(26)+97);
                            break;
                    }
                }
                return verification;
            }
        }
